<script setup lang="ts">
import useMicroStore from '@apps/_share/store/micro'
// import task from '@auth/tasks/task-1'
// import { WorkerFactory } from '@pkgs/utils'
// import useTabStore from '@apps/_share/store/tab'
// import { getRouter } from '@apps/_share/utils'
// import useDemoStore from '@auth/store/demo'
import {
  RouteName,
  // RoutePath,
} from '../../enums'

defineOptions({ name: RouteName.home })

// const demoStore = useDemoStore()

// console.log(1111, demoStore.a)

const {
  $t,
  // getBus,
} = useMicroStore()
// const { getTabs } = useTabStore()

// const router = getRouter()

// function toPage() {
//   router.push({
//     path: RoutePath.userAdmin,
//     // menuCode: '1111111111_auth__user',
//   })
// }

// function toPage1() {
//   router.push({
//     path: RoutePath.appAdminDetail,
//     menuName: '菜单test',
//   })
// }

// function onClose() {
//   getBus.emit('close-tab')
// }

// function onClose1() {
//   getBus.emit('close-tab', { tabCode: getTabs[2].code })
// }

// function onClose2() {
//   getBus.emit('close-tab', {
//     jumpTabCode: 'auth__app',
//     emitParams: {
//       eventName: 'close-tab-test',
//       params: {
//         a: 1,
//         b: 2,
//       },
//     },
//   })
// }

// function onTask() {
//   const {
//     workerId,
//     instance,
//   } = new WorkerFactory(task).create()

//   instance.send(workerId, {
//     a: 1,
//     b: 2,
//   }, (res) => {
//     console.log({ res })
//   })
// }
</script>

<template>
  <div class="h-full flex justify-center items-center text-100px font-bold flex-wrap">
    {{ $t('我是权限中心') }}

    <BaseIcon icon="carbon-home" />
    <!-- <ElButton
      class="ml-16px"
      type="primary"
      @click="onTask()"
    >
      任务测试
    </ElButton> -->

    <!-- <ElButton
      type="primary"
      @click="toPage()"
    >
      菜单内的页面跳转测试
    </ElButton>

    <ElButton
      class="ml-16px"
      type="primary"
      @click="toPage1()"
    >
      不在菜单内的页面跳转测试
    </ElButton>

    <ElButton
      class="ml-16px"
      type="primary"
      @click="onClose()"
    >
      关闭当前激活的tab
    </ElButton>

    <ElButton
      class="ml-16px"
      type="primary"
      @click="onClose1()"
    >
      关闭指定tab
    </ElButton>

    <ElButton
      class="ml-16px"
      type="primary"
      @click="onClose2()"
    >
      关闭当前tab并触发监听事件
    </ElButton> -->
  </div>
</template>
